<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="https://cdn.jsdelivr.net/npm/jquery@1.12.4/dist/jquery.min.js"></script>
</head>

<body>

  <button id="but">发送 post 请求</button>

  <script>
    $(function () {
      $('#but').click(function () {
        $.post('http://www.liulongbin.top:3006/api/addbook', {
          bookname: '雪中悍刀行',
          author: '烽火戏诸侯',
          publisher: '黑马程序员'
        }, function (res) {
          console.log(res)
        })
      })
    })
  </script>
</body>

</html>